package com.myproject.mall.domain.vo;

import com.myproject.mall.domain.entity.Shop;
import lombok.Data;

import java.util.List;

@Data
public class ShopVO {
    private Long id;
    private String title;
    private String description;
    private String poster;
    private String address;
    private Integer fans;

    private List<GoodsVO> goodsList;

    public static ShopVO of(Shop shop, List<GoodsVO> goodsList){
        ShopVO shopVO = new ShopVO();
        shopVO.setId(shop.getId());
        shopVO.setTitle(shop.getTitle());
        shopVO.setDescription(shop.getDescription());
        shopVO.setPoster(shop.getPoster());
        shopVO.setAddress(shop.getAddress());
        shopVO.setFans(shop.getFans());
        shopVO.setGoodsList(goodsList);

        return shopVO;
    }
}
